/* =============================================================================
#     FileName: led_on.c
#         Desc: 
#       Author: joseph_lee
#        Email: joseph_lee2633@163.com
#     HomePage: 
#      Version: 0.0.1
#   LastChange: 2014-05-18 15:15:04
#      History:
============================================================================= */
#define GPFCON ( *(volatile unsigned long *)0x56000050)
#define GPFDAT ( *(volatile unsigned long *)0x56000054)

#define LED1ADDR 1
#define LED2ADDR 2
#define LED3ADDR 3
#define LEDBASE 3

#define LEDON 1
#define LEDOFF 0
void init_led()
{
	int a=0;
	GPFCON=0x1500;
	GPFDAT=0xff;
}

void led_set(unsigned int lednum,int value)
{

			if(value){ //设置为亮。即值为0
				GPFDAT&=~(0x1<<(LEDBASE+lednum));
			}else{	//值为1
				GPFDAT|=0x1<<(LEDBASE+lednum);
			}

}
int main(void)
{
	long a=3000;
	int num=1,on=0;
	init_led();
	while(1){
		led_set(num,1);
		a=3000;
		while(a--);
		led_set(num,0);
		if(num++>3)
			num=1;
	}
	return 0;
}

